@echo off
:: Load VS Commands
CALL "%VS110COMNTOOLS%vsvars32.bat"
SET OUTPUT_DIR=MSTest_TestResults
:: Create output directory
IF EXIST "%OUTPUT_DIR%" RD "%OUTPUT_DIR%" /S /Q
MD "%OUTPUT_DIR%"
:: Build Solution
::MSBuild SIR.sln /target:Rebuild /p:Configuration=Release /p:Platform="Any CPU"
:: Change to output directory
CD "%OUTPUT_DIR%"
:: Run Tests: Common
MSTest /testcontainer:"..\SIR.Common.Tests\bin\Release\SIR.Common.Tests.dll" /resultsfile:"SIR.Common.Tests.trx"
:: Run Tests: DAL
MSTest /testcontainer:"..\SIR.DAL.Tests\bin\Release\SIR.DAL.Tests.dll" /resultsfile:"SIR.DAL.Tests.trx"
:: Run Tests: Entities
MSTest /testcontainer:"..\SIR.Entities.Implementations.Tests\bin\Release\SIR.Entities.Implementations.Tests.dll" /resultsfile:"SIR.Entities.Implementations.Tests.trx"
:: Run Tests: Services
MSTest /testcontainer:"..\SIR.Services.Tests\bin\Release\SIR.Services.Tests.dll" /resultsfile:"SIR.Services.Tests.trx"
:: Run Tests: Web
MSTest /testcontainer:"..\SIR.Web.Tests\bin\Release\SIR.Web.Tests.dll" /resultsfile:"SIR.Web.Tests.trx"
:: JavaScript tests
CD ..\Chutzpah.2.5.0
chutzpah.console ..\SIR.Web.Tests\JavaScript\app /junit ..\MSTest_TestResults\JSTestResults.xml
CD ..\SIR.TestReportGenerator\bin\Release
SIR.TestReportGenerator.exe "%CD%\..\..\..\%OUTPUT_DIR%"